package com.cduoj.ojcodesandbox;

import cn.hutool.core.io.FileUtil;
import com.cduoj.ojcodesandbox.model.ExecuteCodeRequest;
import com.cduoj.ojcodesandbox.model.ExecuteCodeResponse;

import java.io.File;
import java.util.List;

public class JavaNativeCodeSandbox implements CodeSandbox{

    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        List<String> inputList = executeCodeRequest.getInputList();
        String code = executeCodeRequest.getCode();
        String language = executeCodeRequest.getLanguage();
        String userDir = System.getProperty("user.dir");
        String globalCodePathName = userDir + File.separator + "tmpCode";
        //判断全局目录是否存在
        if(!FileUtil.exist(globalCodePathName)){
            FileUtil.mkdir(globalCodePathName);
        }
        return null;
    }
}
